#include <algorithm>
#include <cstring>
#include <iostream>
#include <queue>
#include <vector>

using std::cin;
using std::cout;
using std::priority_queue;
using std::vector;

#define lld long long
#define MAXN 1009
const lld INF = 1e18;

struct edge {
  int u;
  lld dis;

  // 添加构造函数
  edge(int _u = 0, lld _dis = 0) : u(_u), dis(_dis) {}
};

// 重载 operator<，用于优先队列排序（小顶堆）
bool operator<(const edge &a, const edge &b) { return a.dis > b.dis; }

void sol(int n, int m, int k) {
  vector<vector<edge>> G(n + 1);
  for (int i = 0; i < m; ++i) {
    int u, v;
    lld val;
    cin >> u >> v >> val;
    G[u].push_back({v, val});
    G[v].push_back({u, val});
  }

  vector<int> path;
  path.push_back(1); // 起点
  for (int i = 0; i < k; ++i) {
    int x;
    cin >> x;
    path.push_back(x);
  }
  path.push_back(n); // 终点

  lld tot = 0;

  auto dijkstra = [&](int u_start, int v_end, const vector<bool> &ban) -> lld {
    if (u_start == v_end)
      return 0;

    vector<lld> dist(n + 1, INF);
    vector<bool> vis(n + 1, false);
    priority_queue<edge> pq;

    dist[u_start] = 0;
    pq.push({u_start, 0});

    while (!pq.empty()) {
      edge now = pq.top(); // 改成 now 避免变量冲突
      pq.pop();

      int u = now.u;
      lld d = now.dis;

      if (vis[u])
        continue;
      vis[u] = true;

      if (u == v_end)
        break;

      for (auto e : G[u]) {
        int v = e.u;
        lld w = e.dis;
        if (ban[v])
          continue; // 屏蔽点不能走
        if (!vis[v] && dist[v] > d + w) {
          dist[v] = d + w;
          pq.push({v, dist[v]});
        }
      }
    }

    return (dist[v_end] == INF) ? -1 : dist[v_end];
  };

  bool ok = true;
  for (int i = 0; i < (int)path.size() - 1; ++i) {
    int u = path[i];
    int v = path[i + 1];

    vector<bool> ban(n + 1, false);
    for (size_t j = 0; j < path.size(); ++j) {
      if (j != i && j != i + 1) {
        ban[path[j]] = true; // 屏蔽其他中间点
      }
    }

    lld d = dijkstra(u, v, ban);
    if (d == -1) {
      ok = false;
      break;
    }
    tot += d;
  }

  if (ok)
    cout << tot << "\n";
  else
    cout << "Impossible\n";
}

int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);

  while (true) {
    int n, m, k;
    cin >> n >> m >> k;
    if (n == 0 && m == 0 && k == 0)
      break;
    sol(n, m, k);
  }

  return 0;
}